package com.quanyan.stadium.service.gameSign;

import com.alibaba.rocketmq.common.message.MessageExt;
import com.quanyan.api.APIResponse;
import com.quanyan.common.Plugin.PageObj;
import com.quanyan.orderpay.response.mq.OrderNotifyMsg;
import com.quanyan.orderpay.response.mq.RefundNotifyMsg;
import com.quanyan.pay.enums.RefundStatusEnum;
import com.quanyan.stadium.api.req.*;
import com.quanyan.stadium.api.resp.ReqClubUser;
import com.quanyan.stadium.api.resp.RespCheckUser;
import com.quanyan.stadium.api.resp.RespGameResult;
import com.quanyan.stadium.api.resp.RespRecentSignUser;
import com.quanyan.stadium.entity.TbGameEvent;
import com.quanyan.stadium.entity.TbGameOrder;
import com.quanyan.stadium.entity.vo.GamePlaceOrder;
import com.quanyan.stadium.entity.vo.User;

import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: zyq
 * Date: 2016/6/27 0027
 * Time: 15:32
 */

public interface GameSignUpService {


    void updateUserSignCount(List<Integer> uids,int type);
    void updateTbRecentUser(Integer uid,List<Integer> uids);
    /**
     * 退款
     * @param order
     * @param tbGameEvent
     * @return
     */
    APIResponse<RefundStatusEnum> refoundUserPay(TbGameOrder order,TbGameEvent tbGameEvent);
    /**
     * 发送验证码
     * @return
     */
    APIResponse sendSMS(Integer uid);

    APIResponse<TbGameOrder> queryUserOrder(ReqUserOrder request);
    /**
     * 用户是否有报名权限，返回所在俱乐部列表
     *
     * @param request
     * @return
     */
    APIResponse<?> getSignClub(ReqUserSignUp request);

    /**
     * 用户报名活动
     *
     * @param request
     * @return
     */
    APIResponse<?> userSign(ReqUserSignUp request);

    /**
     * 用户报名
     *
     * @param request
     * @return
     */
    APIResponse gameOrder(ReqPay request , boolean isHelpSign);

    /**
     * 支付回调
     * @param orderNotifyMsg
     */
    APIResponse orderPayOperate(OrderNotifyMsg orderNotifyMsg);

    /**
     * 开始调起支付信息
     * @param
     */
    APIResponse prepareCallPay(TbGameEvent tbGameEvent, int signCount, ReqPay request, GamePlaceOrder gamePlaceOrder);


    APIResponse expireCallBack(String orderNo);

    /**
     * 退款
     * @param refundNotifyMsg
     */
    APIResponse refundCallback(RefundNotifyMsg refundNotifyMsg);

    void orderRefundOperate(MessageExt messageExt);

    APIResponse<List<User>> queryGameUser(ReqGameUser request);


    APIResponse abstain(ReqAbstain request);

    void refound(Integer gameId);

    /**
     * 俱乐部比赛的结算
     * @return
     */
    APIResponse setterUp(Integer gameId);


    Map<Integer,Integer> outerGameSignUp(List<Integer> uids, Integer gameId,boolean flag);


    /**
     * 判断用户是否已经报名了对抗赛
     * @param request
     * @return
     */
    APIResponse<RespGameResult> checkSign(ReqSignResult request);


    /**
     * 判断用户是否是百灵鸟用户
     * @param request
     * @return
     */
    APIResponse<RespCheckUser> checkUser(ReqCheckUser request);

    /**
     * 查询最近代报名成员列表
     * @param request
     * @return
     */
    PageObj<List<RespRecentSignUser>> getRecentSignUser(ReqRecentSginUser request);


    /**
     * 代报名成员列表
     * @param request
     * @return
     */
    APIResponse<PageObj<List<RespRecentSignUser>>> helpSign(ReqRecentSginUser request);

    /**
     * 查询俱乐部成员信息
     * @param request
     * @return
     */
    APIResponse<List<RespRecentSignUser>> getClubUser(ReqRecentSginUser request);


    APIResponse<RespRecentSignUser> getUserMsg(ReqUserMsg request);


    APIResponse<RespRecentSignUser> getClubUserMsg(ReqClubUser request);


    APIResponse insertTeam(int gameId, List<List<Integer>> uids,int isDouble);

    /**
     *  根据重新编排的逻辑,更新用户编排逻辑
     *
     * */
    void updateDoubleTeam(int gameEventId, List<List<Integer>> uids);



}
